package com.zjmzxfzhl.modules.purchase.controller;

import com.zjmzxfzhl.common.Result;
import com.zjmzxfzhl.common.base.BaseController;
import com.zjmzxfzhl.modules.purchase.controller.dto.PurchasePaymentQueryDto;
import com.zjmzxfzhl.modules.purchase.controller.vo.CalendarContentVo;
import com.zjmzxfzhl.modules.purchase.service.PurchaseCalendarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * Controller
 *
 * @author 庄金明
 */
@RestController
@RequestMapping("/purchase/calendar")
public class PurchaseCalendarController extends BaseController {
    @Autowired
    private PurchaseCalendarService purchaseCalendarService;

    /**
     * @return
     * @功能：查询日历内容
     */
    @PostMapping(value = "/content")
    public Result getContent(@RequestBody PurchasePaymentQueryDto queryDto) {
        Map<String, List<CalendarContentVo>> result = purchaseCalendarService.loadCalendarContent(queryDto);
        return Result.ok(result);
    }


}
